﻿using HDM.NexusEngine.Core;
using HDM.NexusEngine.Input;
using HDM.NexusEngine.PathFinding;

namespace HDM.NexusEngine.Editor
{
    public class AddPolygonState : IGameObject
    {
        private readonly InputManager _input;
        private readonly NavMesh _navMesh;

        public AddPolygonState(InputManager input, NavMesh navMesh)
        {
            _input = input;
            _navMesh = navMesh;
        }

        public void Update(double elapsedTime)
        {
            if (_input.Mouse.LeftPressed)
            {
                _navMesh.AddPolygon(new ConvexPolygon(_input.Mouse.Position));
            }
        }

        public void Render()
        {
            
        }

        public void Activated()
        {

        }
    }
}